<section class="comments-list">
  <h1><span>热门评论</span></h1>
  [#list list as c]
  <div class="comments-item">
    <div class="tx">
    <img src="${base}/${(c.commentUser.userImg)!'${site.defImg!}'}">
    </div>
    <div class="rig">
      <div class="rig-top"><a class="username">[#if c.commentUser??]${(c.commentUser.username)!"匿名网友"}[#else]匿名网友[/#if]</a><em> ${c.createTime} </em></div>
      <div class="rig-txt">${c.textHtml!}</div>
      <div class="rig-bottom">
	     <a class="comments-zan" onclick="Cms.commentUp('${base}',${c.id},${c.ups},'commentups_${c.id}')">赞<span id="commentups_${c.id}">${c.ups!}</span></a>
		 
          <!--
		 <span class="commentdown" onclick="Cms.commentDown('${base}',${c.id},${c.downs},'commentdowns_${c.id}')">踩</span>
		 <span id="commentdowns_${c.id}">${c.downs!}</span>   -->
      	 <a class="comments-hf" id="commentreply_${c.id}" onclick="Cms.commentInputLoad('${base}','commentInputDiv_','commentInputDiv_${c.id}','${contentId!}','${c.id}')">回复</a>
	   </div>	
	   <div class="reply" id="commentInputDiv_${c.id}"></div>
      [#if c??&&c.replyCount>0]
      <div class="comments-item comments-child">
	    <div class="tx"><img src="[#if c.replayUser??]${(c.replayUser.userImg)!'${site.defImg!}'}[#else]'${site.defImg!}'[/#if]"></div>
	    <div class="rig">
	      <div class="rig-top"><a class="username">[#if c.replayUser??]${(c.replayUser.username)!"管理员"}[#else]匿名[/#if]</a>
		  <em>[#if c.replayTime??]${c.replayTime?string("yyyy-MM-dd HH:mm:ss")}[/#if]</em></div>
	      <div class="rig-txt">${c.replayHtml!}</div>
	      <div class="rig-bottom">
	      		 <a class="comments-zan" onclick="Cms.commentUp('${base}',${c.id},${c.ups},'commentups_${c.id}')">赞<span id="commentups_${c.id}">${c.ups!}</span></a>
  				 
		      	 <a class="comments-hf" id="commentreply_${c.id}" onclick="Cms.commentInputLoad('${base}','commentInputDiv_','commentInputDiv_${c.id}','${contentId!}','${c.id}')">回复</a>
				  [#if c.replyCount>0]
				  <span id="commentviewreply_${c.id}" onclick="Cms.commentListMore('${base}','commentDialog',{parentId:${c.id},contentId:${contentId!},orderBy:0,count:5,checked:1})">查看回复(${c.replyCount!})</span>
				  [/#if]
				  <div id="commentInputDiv_${c.id}"></div>
	      </div>
	      <div class="reply"><textarea class="reply-text"></textarea><div><input type="submit" value="回复" class="reply-btn"></div></div>
	    </div>
	  </div>
	  [/#if]
    </div>
  </div>
  [/#list]
  <div class="open-more"><a href="${base}/comment.jspx?contentId=${contentId!}">更多评论</a></div>
</section>
<div id="commentDialog" style="display:none;"></div>
<script type="text/javascript">
$(function() {
	$("#commentDialog").dialog({
		autoOpen: false,
		modal: true,
		width: 500,
		height: 600,
		position: ["center",20],
		buttons: {
			"关闭": function() {
				$(this).dialog("close");
			}
		},
		close: function(event, ui) {
		}
	});
    [#if !parentId??]
     $(".comments-hf").bind("click", function(){
                  $(this).toggleClass("reply-on");
		  $(this).parent().siblings(".reply").animate({height:'toggle'},10);
      });
    [#else]
      $(".comments-hf").unbind();
      $(".comments-hf").bind("click", function(){
                  $(this).toggleClass("reply-on");
		  $(this).parent().siblings(".reply").animate({height:'toggle'},10);
      });
    [/#if]
});
</script>